package cn.jekun.shop.reg.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;

import cn.jekun.component.base.utils.EncryptUtil;
/**
 * reg注册
 * @author twj
 *
 */
@SuppressWarnings("serial")
public class RegServlet extends HttpServlet{
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		
		String userId = EncryptUtil.decodeBase64(req.getParameter("u"));//用戶代码
		String shopId = EncryptUtil.decodeBase64(req.getParameter("s"));//商家代码
		if(StringUtils.isBlank(userId)){
			userId = "";
		}
		if(StringUtils.isBlank(shopId)){
			shopId = "";
		}
		req.setAttribute("tempShopId", shopId);
		req.setAttribute("userId", userId);
		//resp.sendRedirect("/shop/reg/reg.jsp");
		req.getRequestDispatcher("/reg/reg.jsp").forward(req, resp);
	}
}
